<!DOCTYPE html>
<html lang="zh">
<head>
    <link rel="shortcut icon" type="image/x-icon" href="https://pic2.imgdb.cn/item/645f706d0d2dde5777ebe4b2.jpg" />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生日倒计时</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #000000;
            text-align: center;
            padding: 50px;
            transition: background 1s;
        }
        h1 {
            font-size: 2em;
            color: #333;
        }
        #countdown {
            font-size: 1.5em;
            color: #f44336;
            margin: 20px 0;
        }
        #wishes {
            font-size: 1.2em;
            color: #333;
            line-height: 1.5;
            max-width: 800px;
            margin: 0 auto;
        }
        #birthday-wishes {
            display: none;
        }
        #birthday-wishes h2 {
            font-size: 3em;
            color: #ffffff;
            margin: 0 auto;
            text-align: center;
            animation: blink 1s linear infinite;
        }
        /* 页面美化 */
        h1, #countdown, #wishes h2 {
            color: #ffffff;
        }
        @keyframes blink {
            0% {
                opacity: 1;
            }
            50% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }
    </style>
</head>
<body>
    <div id="before-birthday">
        <h1>距离唐小姐生日还有：</h1>
        <div id="countdown"></div>
    </div>
    <div id="birthday-wishes">
        <h2>你好，16岁的姑娘</h2>
    </div>
    <script>
        function updateCountdown() {
            const birthday = new Date('2023-05-15'); // 唐的生日
            const now = new Date();
            const diff = birthday - now;
            if (diff <= 0) {
                document.getElementById('before-birthday').style.display = 'none';
                document.getElementById('birthday-wishes').style.display = 'block';
                document.body.style.background = ''; // 设置背景颜色为空白
                setTimeout(function() {
                    window.location.href = 'https://adonis142857.gitee.io/birthday/say/index.html';
                }, 6000); // 6秒后跳转到指定网站
            } else {
                const days = Math.floor(diff / (1000 * 60 * 60 * 24));
                const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
                const seconds = Math.floor((diff % (1000 * 60)) / 1000);
                const milliseconds = diff % 1000;
                document.getElementById('countdown').innerHTML = days + ' 天 ' + hours + ' 小时 ' + minutes + ' 分 ' + seconds + ' 秒 ' + milliseconds + ' 毫秒';
                // 动态背景效果
                const progress = 1 - (diff / (1000 * 60 * 60 * 24 * 2)); // 将周期改为2天
                const dawnColor = '#0b3d91';
                const sunriseColor = '#fda085'; // 将结束颜色改为黄橙色
                const backgroundColor = `linear-gradient(120deg, ${dawnColor} ${progress * 100}%, ${sunriseColor} ${progress * 100}%)`;
                document.body.style.background = backgroundColor;
            }
        }
        updateCountdown();
        setInterval(updateCountdown, 1); // 每毫秒更新一次
    </script>
</body>
</html>
